package com.census.entity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.sql.Date;

/**
 * Created by WangKai's Hands.
 * User:WangKai
 * Date:2017/7/9
 * Time:14:11
 * Email: 1786025737@qq.com
 */
@Entity
public class Temporary {
    private int stayId;
    private String cardId;
    private String name;
    private String sex;
    private String nation;
    private Date birthday;
    private String bloodType;
    private String usedName;
    private double height;
    private String nativePlace;
    private String job;
    private String faith;
    private String photo;
    private String politicesStuts;
    private String degree;
    private String marriage;

    @Id
    @Column(name = "stay_id")
    public int getStayId() {
        return stayId;
    }

    public void setStayId(int stayId) {
        this.stayId = stayId;
    }

    @Basic
    @Column(name = "card_id")
    public String getCardId() {
        return cardId;
    }

    public void setCardId(String cardId) {
        this.cardId = cardId;
    }

    @Basic
    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "sex")
    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    @Basic
    @Column(name = "nation")
    public String getNation() {
        return nation;
    }

    public void setNation(String nation) {
        this.nation = nation;
    }

    @Basic
    @Column(name = "birthday")
    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    @Basic
    @Column(name = "blood_type")
    public String getBloodType() {
        return bloodType;
    }

    public void setBloodType(String bloodType) {
        this.bloodType = bloodType;
    }

    @Basic
    @Column(name = "used_name")
    public String getUsedName() {
        return usedName;
    }

    public void setUsedName(String usedName) {
        this.usedName = usedName;
    }

    @Basic
    @Column(name = "height")
    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    @Basic
    @Column(name = "native_place")
    public String getNativePlace() {
        return nativePlace;
    }

    public void setNativePlace(String nativePlace) {
        this.nativePlace = nativePlace;
    }

    @Basic
    @Column(name = "job")
    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }

    @Basic
    @Column(name = "faith")
    public String getFaith() {
        return faith;
    }

    public void setFaith(String faith) {
        this.faith = faith;
    }

    @Basic
    @Column(name = "photo")
    public String getPhoto() {
        return photo;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    @Basic
    @Column(name = "politices_stuts")
    public String getPoliticesStuts() {
        return politicesStuts;
    }

    public void setPoliticesStuts(String politicesStuts) {
        this.politicesStuts = politicesStuts;
    }

    @Basic
    @Column(name = "degree")
    public String getDegree() {
        return degree;
    }

    public void setDegree(String degree) {
        this.degree = degree;
    }

    @Basic
    @Column(name = "marriage")
    public String getMarriage() {
        return marriage;
    }

    public void setMarriage(String marriage) {
        this.marriage = marriage;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Temporary temporary = (Temporary) o;

        if (stayId != temporary.stayId) return false;
        if (Double.compare(temporary.height, height) != 0) return false;
        if (cardId != null ? !cardId.equals(temporary.cardId) : temporary.cardId != null) return false;
        if (name != null ? !name.equals(temporary.name) : temporary.name != null) return false;
        if (sex != null ? !sex.equals(temporary.sex) : temporary.sex != null) return false;
        if (nation != null ? !nation.equals(temporary.nation) : temporary.nation != null) return false;
        if (birthday != null ? !birthday.equals(temporary.birthday) : temporary.birthday != null) return false;
        if (bloodType != null ? !bloodType.equals(temporary.bloodType) : temporary.bloodType != null) return false;
        if (usedName != null ? !usedName.equals(temporary.usedName) : temporary.usedName != null) return false;
        if (nativePlace != null ? !nativePlace.equals(temporary.nativePlace) : temporary.nativePlace != null)
            return false;
        if (job != null ? !job.equals(temporary.job) : temporary.job != null) return false;
        if (faith != null ? !faith.equals(temporary.faith) : temporary.faith != null) return false;
        if (photo != null ? !photo.equals(temporary.photo) : temporary.photo != null) return false;
        if (politicesStuts != null ? !politicesStuts.equals(temporary.politicesStuts) : temporary.politicesStuts != null)
            return false;
        if (degree != null ? !degree.equals(temporary.degree) : temporary.degree != null) return false;
        if (marriage != null ? !marriage.equals(temporary.marriage) : temporary.marriage != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result;
        long temp;
        result = stayId;
        result = 31 * result + (cardId != null ? cardId.hashCode() : 0);
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (sex != null ? sex.hashCode() : 0);
        result = 31 * result + (nation != null ? nation.hashCode() : 0);
        result = 31 * result + (birthday != null ? birthday.hashCode() : 0);
        result = 31 * result + (bloodType != null ? bloodType.hashCode() : 0);
        result = 31 * result + (usedName != null ? usedName.hashCode() : 0);
        temp = Double.doubleToLongBits(height);
        result = 31 * result + (int) (temp ^ (temp >>> 32));
        result = 31 * result + (nativePlace != null ? nativePlace.hashCode() : 0);
        result = 31 * result + (job != null ? job.hashCode() : 0);
        result = 31 * result + (faith != null ? faith.hashCode() : 0);
        result = 31 * result + (photo != null ? photo.hashCode() : 0);
        result = 31 * result + (politicesStuts != null ? politicesStuts.hashCode() : 0);
        result = 31 * result + (degree != null ? degree.hashCode() : 0);
        result = 31 * result + (marriage != null ? marriage.hashCode() : 0);
        return result;
    }
}
